package com.itheima_06;

/**
 * @author Xiao
 * @date 2021/7/6
 */
public class StingBuilderDemo01 {
    public static void main(String[] args) {
        //获取1970年1月1日0时0分0秒到当前所经历的毫秒值。
        long start = System.currentTimeMillis();
        System.out.println(start);
        String s = "";
        for (int i = 0; i < 10000; i++) {
            s += i;
        }
        long end = System.currentTimeMillis();
        System.out.println(end - start);
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < 10000; i++) {
            sb.append(i);
        }
        long end2 = System.currentTimeMillis();
        System.out.println(end2 - end);
    }
}
